/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package at.nhmwien.schema_mapping_tool.schemes;

import java.util.*;
import java.io.*;
import at.nhmwien.schema_mapping_tool.schemaReaders.*;

/**
 *
 * @author wkoller
 */
public abstract class Schema {
    public LinkedHashMap<String,LinkedHashMap> getSchemaContent() {
        try {
            InputStream inputFile = getClass().getResourceAsStream( this.getResourceName() );

            FileConverter conv = this.getFileConverter();
            return conv.parseFile(inputFile);

/*            File tmpFile = File.createTempFile( "currSchema", null );
            FileWriter writer = new FileWriter( tmpFile );

            writer.write(schemaContent);
            writer.close();*/
        }
        catch( Exception e ) {
            e.printStackTrace();
        }

        return null;
    }

    protected abstract FileConverter getFileConverter();
    protected abstract String getResourceName();
}
